package cn.powertime.evaluation.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
public class ReqTopicListVo implements Serializable {

    @ApiModelProperty(value = "习题ID", position = 1)
    @NotNull(message = "习题ID不能为空")
    private Long id;

    @ApiModelProperty(value = "用户答案", position = 2)
    private String userAnswer;

    @Override
    public String toString() {
        if (StringUtils.isEmpty(userAnswer)) {
            return "{id:" + id + ",userAnswer:" + null + "}";
        } else {
            return "{id:" + id + ",userAnswer:'" + userAnswer + "'}";
        }
    }
}
